package cn.chencaiju.query;

import java.io.IOException;

import org.apache.lucene.document.LongPoint;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;

import cn.chencaiju.utils.LuceneUtils;

public class MyNumberQuery {
	public static void main(String[] args) throws IOException {
		// IndexSearcher
		IndexSearcher indexSearcher = LuceneUtils.getIndexSearcher();
		
		// 创建查询Query 查询文件大小在0k - 100000K之间的
		Query query = LongPoint.newRangeQuery("size", 0, 100000);

		TopDocs topDocs = indexSearcher.search(query, 100);
		LuceneUtils.printResult(indexSearcher, topDocs);
	}
}
